# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

add_executable(
  pollux_functions_spark_test
  ArithmeticTest.cpp
  ArrayAppendTest.cpp
  ArrayConcatTest.cpp
  ArrayFlattenTest.cpp
  ArrayGetTest.cpp
  ArrayInsertTest.cpp
  ArrayMaxTest.cpp
  ArrayMinTest.cpp
  ArraySortTest.cpp
  ArrayShuffleTest.cpp
  ArrayUnionTest.cpp
  ArgTypesGeneratorTest.cpp
  AtLeastNNonNullsTest.cpp
  BitwiseTest.cpp
  ComparisonsTest.cpp
  ConcatWsTest.cpp
  DateTimeFunctionsTest.cpp
  DecimalArithmeticTest.cpp
  DecimalCompareTest.cpp
  DecimalRoundTest.cpp
  DecimalUtilTest.cpp
  ElementAtTest.cpp
  FromJsonTest.cpp
  GetJsonObjectTest.cpp
  GetStructFieldTest.cpp
  HashTest.cpp
  InTest.cpp
  JsonArrayLengthTest.cpp
  JsonObjectKeysTest.cpp
  LeastGreatestTest.cpp
  MakeDecimalTest.cpp
  MakeTimestampTest.cpp
  MapConcatTest.cpp
  MapTest.cpp
  MaskTest.cpp
  MightContainTest.cpp
  MonotonicallyIncreasingIdTest.cpp
  RaiseErrorTest.cpp
  RandTest.cpp
  RegexFunctionsTest.cpp
  SliceTest.cpp
  SizeTest.cpp
  SortArrayTest.cpp
  SparkCastExprTest.cpp
  SparkPartitionIdTest.cpp
  SplitTest.cpp
  StringTest.cpp
  StringToMapTest.cpp
  UnscaledValueFunctionTest.cpp
  UuidTest.cpp
  XxHash64Test.cpp)

add_test(pollux_functions_spark_test pollux_functions_spark_test)

target_link_libraries(
  pollux_functions_spark_test
  pollux_functions_spark
  pollux_functions_test_lib
  pollux_exec_test_lib
  pollux_expression_fuzzer_test_utility
  pollux_expression_fuzzer
  fmt::fmt
  GTest::gtest
  GTest::gtest_main
  GTest::gmock)

add_executable(pollux_spark_function_registry_test RegisterTest.cpp)

add_test(pollux_spark_function_registry_test pollux_spark_function_registry_test)

target_link_libraries(
  pollux_spark_function_registry_test
  pollux_expression
  pollux_functions_spark
  GTest::gtest
  GTest::gtest_main)
